import * as Mock from 'mockjs'
const Random = Mock.Random

let swiper: Layout = {
    type: 1,
    swiper: [
        {
            imageUrl: 'https://z1.ax1x.com/2023/09/19/pP5ilVS.jpg',
            pageUrl: 'http://seqpl.tn/upylxji'
        },
        {
            imageUrl: 'https://z1.ax1x.com/2023/09/19/pP5iKDf.jpg',
            pageUrl: 'http://jcg.it/djnowv'
        },
        {
            imageUrl: 'https://z1.ax1x.com/2023/09/19/pP5iuKP.jpg',
            pageUrl: 'http://dhqxxr.sr/edpduuriqu'
        },
        {
            imageUrl: 'https://z1.ax1x.com/2023/09/19/pP5imvt.jpg',
            pageUrl: 'http://elw.pl/adhgi'
        },
        {
            imageUrl: 'https://z1.ax1x.com/2023/09/19/pP5iMb8.jpg',
            pageUrl: 'http://elw.pl/adhgi'
        }
    ]
}
let arr: Array<ImageLink> = []
for (let i = 0; i < 10; i++) {
    arr.push({
        title: Random.ctitle(2, 4),
        imageUrl: 'https://z1.ax1x.com/2023/11/30/pirYHFs.png',
        pageUrl: ''
    })
}
let quickAccess: Layout = {
    type: 9,
    quickAccess: arr
}

let imagelink: Layout = {
    type: 7,
    imageLink: {
        imageUrl: 'https://z1.ax1x.com/2023/11/30/pirYowQ.png',
        pageUrl: '',
        height: 55
    }
}
let timeRange: TimeRange[] = []
let starttime = new Date().getTime()
for (let i = 0; i < 4; i++) {
    let endtime = starttime + i * Random.integer(1, 2)
    timeRange.push({
        beginTime: starttime,
        endTime: endtime
    })
    starttime = endtime
}
let miaosha: Layout = {
    type: 10,
    miaosha: {
        pageUrl: '',
        times: timeRange
    }
}

let imagelink2: Layout = {
    type: 7,
    imageLink: {
        imageUrl: 'https://z1.ax1x.com/2023/11/30/pirtkSx.md.png',
        pageUrl: '',
        height: 200
    }
}

let productListUrl: Layout = {
    type: 11,
    productListUrl: 'https://mock.apifox.com/m1/3319286-0-default/product/list'
}

let quickAccess2: Layout = {
    type: 12,
    quickAccess: arr
}

let topic0: Array<Layout> = [swiper, imagelink, quickAccess, miaosha, imagelink2, productListUrl]

let res = {
    code: 200,
    message: 'ok',
    data: topic0
}
console.log(JSON.stringify(res))
